using System;
using System.Web.UI;

using Impact.Web.Foundation;
using Impact.Model.Objects;
using Impact.Model.Service;
using StructureMap;
using Impact.Controllers;

namespace Impact.Web.Controls
{
    public partial class DisplayCategories : Impact.Web.Foundation.DynamicPageControlBase
    {

        /// <summary>
        /// Loads the categories that will be displayed and binds them
        /// to the repeater
        /// </summary>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.categoryRepeater.DataSource = ArticleController.GetAllCategories(true);
            this.categoryRepeater.DataBind();

            this.tagRepeater.DataSource = ArticleController.GetAllTags();
            this.tagRepeater.DataBind();


        }

        /// <summary>
        /// Retrieves the title for the page this control is building
        /// </summary>
        protected override string PageTitle
        {
            get { return "Available Article Categories"; }
        }

    }
}